<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <h:head>

        <p:commandButton value="ciao" />
        
        
        <h:form enctype="multipart/form-data">
            

            <p:fileUpload fileUploadListener="#{fileUploadController.handleFileUpload}"
                          mode="advanced"
                          update="messages"
                          auto="true"
                          sizeLimit="100000" 
                          allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>

            <p:growl id="messages" showDetail="true"/>

        </h:form>

        <h3>Client</h3>  

        <h:form>

            <p:growl id="messages"/>

            <h3>Default Menubar</h3>
            <p:menubar>
                <p:submenu label="File" icon="ui-icon-document">
                    <p:submenu label="New" icon="ui-icon-contact">
                        <p:menuitem value="Project" url="#" />
                        <p:menuitem value="Other" url="#" />
                    </p:submenu>
                    <p:menuitem value="Open" url="#" />
                    <p:separator />
                    <p:menuitem value="Quit" url="#" />
                </p:submenu>

                <p:submenu label="Edit" icon="ui-icon-pencil">
                    <p:menuitem value="Undo" url="#" icon="ui-icon-arrowreturnthick-1-w" />
                    <p:menuitem value="Redo" url="#" icon="ui-icon-arrowreturnthick-1-e" />
                </p:submenu>

                <p:submenu label="Help" icon="ui-icon-help">
                    <p:menuitem value="Contents" url="#" />
                    <p:submenu label="Search" icon="ui-icon-search">
                        <p:submenu label="Text">
                            <p:menuitem value="Workspace" url="#" />
                        </p:submenu>
                        <p:menuitem value="File" url="#" />
                    </p:submenu>
                </p:submenu>

                <p:submenu label="Actions" icon="ui-icon-gear">
                    <p:submenu label="Ajax" icon="ui-icon-refresh">
                        <p:menuitem value="Save" actionListener="#{menuBean.save}" icon="ui-icon-disk" update="messages"/>
                        <p:menuitem value="Update" actionListener="#{menuBean.update}" icon="ui-icon-arrowrefresh-1-w" update="messages"/>
                    </p:submenu>
                    <p:submenu label="Non-Ajax" icon="ui-icon-newwin">
                        <p:menuitem value="Delete" actionListener="#{menuBean.delete}" icon="ui-icon-close" update="messages" ajax="false"/>
                    </p:submenu>
                </p:submenu>

                <p:menuitem value="Quit" url="http://www.primefaces.org" icon="ui-icon-close" />

                <f:facet name="options">
                    <p:inputText style="margin-right:10px"/>
                    <p:commandButton type="button" value="Logout" icon="ui-icon-extlink" />
                </f:facet>
            </p:menubar>

            <h3>Click Trigger</h3>
            <p:menubar autoDisplay="false">
                //same content as default menubar
            </p:menubar>

        </h:form>


        <title>PrimeFaces Test</title>

        <style>

            .ui-widget {

                font-size: 12px !important;

            }

        </style>

    </h:head>

    <h:body>

        <h:form id="mainForm">

            <p:panel header="Match Mode" style="width: 500px;">

                <h:panelGrid columns="2" id="matchGrid">

                    <h:outputLabel value="Username:  " />

                    <p:inputText id="user" value="#{passwordBean.username}"

                                 label="Username:" required="true" />



                    <h:outputLabel for="pwd1" value="Password 1: *" />

                    <p:password id="pwd1" value="#{passwordBean.password}"

                                match="pwd2" label="Password 1"

                                required="true" feedback="true" />



                    <h:outputLabel for="pwd2" value="Password 2: *" />

                    <p:password id="pwd2" value="#{passwordBean.password}"

                                label="Password 2" required="true"

                                feedback="true" />

                </h:panelGrid>

                <br />

                <p:commandButton id="saveButton"

                                 update="matchGrid,userOut,passOut"

                                 value="Save" type="submit" onclick="dlg.show();" />



                <p:dialog header="Response" position="0,0" id="dialog"

                          widgetVar="dlg" modal="true" showEffect="explode"

                          hideEffect="bounce" height="200" width="500"

                          style="margin:50px">

                    <p:messages id="messages" showDetail="true"

                                autoUpdate="true" />

                    <h:panelGrid columns="2">

                        <h:outputLabel value="Username:  " />

                        <h:outputText id="userOut"

                                      value="#{passwordBean.username}"

                                      label="Username:" />



                        <h:outputLabel value="Password : " />

                        <h:outputText id="passOut"

                                      value="#{passwordBean.password}"

                                      label="Password" />

                    </h:panelGrid>

                </p:dialog>

            </p:panel>
            <h:form>  

                <p:growl id="messages"/>  

                <p:splitButton value="Save" actionListener="#{buttonBean.save}" update="messages" icon="ui-icon-disk">  
                    <p:menuitem value="Update" actionListener="#{buttonBean.update}" update="messages" icon="ui-icon-arrowrefresh-1-w"/>  
                    <p:menuitem value="Delete" actionListener="#{buttonBean.delete}" ajax="false" icon="ui-icon-close"/>  
                    <p:separator />  
                    <p:menuitem value="Homepage" url="http://www.primefaces.org" icon="ui-icon-extlink"/>  
                </p:splitButton>  

            </h:form>  

        </h:form>


    </h:body>

</html>


